package com.microcity.autocomponent.autoview;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

public class LEDTextView extends AppCompatTextView {

    public LEDTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public LEDTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        changeTypeFace(context, attrs);
    }

    public LEDTextView(Context context) {
        super(context);
    }

    /**
     * 改变字体类型
     * @param context
     * @param attrs
     */
    private void changeTypeFace(Context context, AttributeSet attrs)
    {
        if (attrs != null)
        {
            Typeface mtf = Typeface.createFromAsset(context.getAssets(),
                    "fonts/UnidreamLED.ttf");
            super.setTypeface(mtf);
        }
    }
}